package db

import (
	"gopkg.in/yaml.v2"
	"gotest/src/modles"
	"io/ioutil"
	"log"
)

func LoadConfig() *modles.MyConfig {
	myConfig := new(modles.MyConfig)
	yamlFile, err :=
		ioutil.ReadFile("application.yml")
	if err != nil {
		log.Printf("yaml open err is : \n %v \n", err)
	}
	erryml := yaml.Unmarshal(yamlFile, myConfig)
	if erryml != nil {
		log.Printf("unmarshel err is \n %v \n", erryml)
	}
	return myConfig
}
